<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    
    </style>
</head>
<body>
    <h3>恭喜你支付成功</h3>
    <p><span class="text">10</span>s后自动跳转！</p>
    <button class="btn">取消</button>

    <script>
        var btn = document.querySelector(".btn")
        btn.onclick = function(){
            location.href = ""
        }
        var text = document.querySelector("text")
        var num =10
        setInterval(function(){
            num--
            text.innerHTML = num
            if(num == 0){
                location.href
            }
        },1000)
    </script>
</body>
</html>